using System.Web;
using System.Web.UI;

/// <summary>
/// Summary description for ShowMessage
/// </summary>
public static class Alert
{
   public static void Show(string message)
   {
       string cleanString = message.Replace("'", "\\'");
       string script="<script type=\"text/javascript\">alert('"+cleanString+"');</script >";
       Page page = HttpContext.Current.CurrentHandler as Page;
       if(page!=null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
       {
           page.ClientScript.RegisterClientScriptBlock(typeof(Alert),"alert",script);
       }
   }
}
